﻿using System;
using System.Windows;
using Honest.MES.Contracts.Interfaces;

namespace Honest.MES.WPF.Services
{
    public class ExceptionHandler : IExceptionHandler
    {
        public void HandleException(Exception ex, string context = null)
        {
            MessageBox.Show(
                $"发生错误{(context != null ? $"在{context}" : "")}: {ex.Message}\n\n请联系系统管理员。",
                "错误",
                MessageBoxButton.OK,
                MessageBoxImage.Error);
        }
    }
}